#include "jolfs/master_volume.h"

#include <boost/foreach.hpp>

using namespace jolfs;

MasterVolume::~MasterVolume()
{
  // Deallocate volume, be sure that
  // the shutdown method was previously call.
  BOOST_FOREACH(Volume* v, volumes_) {
    delete v;
  }
  volumes_.clear();
}

void MasterVolume::appendVolume(Volume* vol)
{
  volumes_.push_back(vol);
}

void MasterVolume::shutdown()
{
  BOOST_FOREACH(Volume* v, volumes_) {
    v->shutdown();
  }
}

